//      decree.h
//      
//      Copyright 2012 dimir <dimir@dimir-pc>
//      
//      This program is free software; you can redistribute it and/or modify
//      it under the terms of the GNU General Public License as published by
//      the Free Software Foundation; either version 2 of the License, or
//      (at your option) any later version.
//      
//      This program is distributed in the hope that it will be useful,
//      but WITHOUT ANY WARRANTY; without even the implied warranty of
//      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//      GNU General Public License for more details.
//      
//      You should have received a copy of the GNU General Public License
//      along with this program; if not, write to the Free Software
//      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
//      MA 02110-1301, USA.
//      
//      


#ifndef DECREE_H
#define DECREE_H

#include <fstream>

// Направления движения для жуков: влево(0), вверх(1), вправо(2), вниз(3)
enum Direction{LEFT, UP, RIGHT, DOWN};


/**
 * Класс описывает приказ игрока жукам о0
 * Все поля инициализируются конструктором.
 */ 

class Decree
{
	public:
		Decree();
		Decree(const int& row, const int& column,
			   const Direction& direction, const int& number_bug);
		Direction getDirection() const;
		int getRow() const;
		int getColumn() const;
		int getNumberBug() const;
		friend std::istream& operator >>(std::istream& f, Decree& decree){
			int direction;
			f >> decree.row >> decree.column >> direction >> decree.number_bug;
			decree.direction = Direction(direction);
			return f; 
		}
		friend std::ostream& operator <<(std::ostream& f, Decree& decree){
			f << decree.row << " " << decree.column <<
			  " " << (unsigned int)(decree.direction) <<
			  " " << decree.number_bug << std::endl;
			  f.flush();
			 return f;
		}
		
	private:
		/* add your private declarations */
		int row;
		int column;
		int number_bug;
		Direction direction;
};

#endif /* DECREE_H */ 
